package org.osomit.sacct.builder;

import org.osomit.sacct.entity.RequestContext;

import java.util.Map;

/**
 * @author Jian Fang (John.Jian.Fang@gmail.com)
 *
 * Date: Jun 28, 2009
 */
public class RequestContextBuilder extends BaseBuilder<RequestContext> {

    public RequestContext build(Object object) {
        if(object != null){
            RequestContext context = new RequestContext();
            Map map = (Map) object;
            context.setLocale((String) map.get(RequestContext.LOCALE));
            context.setClientId((String) map.get(RequestContext.CLIENT_ID));
            context.setRequestId((String) map.get(RequestContext.REQUEST_ID));
            
            return context;
        }

        return null;
    }

}
